package com.ruoyi.common.core.domain.entity;

import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 部门表 sys_dept
 *
 * @author ess
 */
public class SysDept extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 部门ID
     */
    private Long deptId;

    /**
     * 父部门ID
     */
    private Long parentId;

    /**
     * 祖级列表
     */
    private String ancestors;

    /**
     * 部门名称
     */
    private String deptName;

    /**
     * 显示顺序
     */
    private String orderNum;

    /**
     * 负责人
     */
    private String leader;

    /**
     * 联系电话
     */
    private String phone;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 部门状态:0正常,1停用
     */
    private String status;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    private String delFlag;

    /**
     * 父部门名称
     */
    private String parentName;
    /**
     * 统一社会信用代码
     */
    private String creditCode;
    /**
     * 类型 1 单位 2部门
     */
    private String typeCode;
    /**
     * 行政区划代码
     */
    private String areaNumber;
    /**
     * 英文名称
     */
    private String nameEn;
    /**
     * 少数民族名称
     */
    private String nameSh;
    /**
     * 单位所在省份
     */
    private String uProvince;
    /**
     * 单位所在城市
     */
    private String uCity;
    /**
     * 外部id
     */
    private String sysDepId;
    /**
     * 外部父级id
     */
    private String sysDepIdParent;

    /**
     * 子部门
     */
    private List<SysDept> children = new ArrayList<SysDept>();

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getAncestors() {
        return ancestors;
    }

    public void setAncestors(String ancestors) {
        this.ancestors = ancestors;
    }

    @NotBlank(message = "单位名称不能为空")
    @Size(min = 0, max = 30, message = "单位名称长度不能超过30个字符")
    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    @NotBlank(message = "显示顺序不能为空")
    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public String getLeader() {
        return leader;
    }

    public void setLeader(String leader) {
        this.leader = leader;
    }

    @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Email(message = "邮箱格式不正确")
    @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public List<SysDept> getChildren() {
        return children;
    }

    public void setChildren(List<SysDept> children) {
        this.children = children;
    }


    public String getCreditCode() {
        return creditCode;
    }

    public void setCreditCode(String creditCode) {
        this.creditCode = creditCode;
    }

    public String getTypeCode() {
        return typeCode;
    }

    public void setTypeCode(String typeCode) {
        this.typeCode = typeCode;
    }

    public String getAreaNumber() {
        return areaNumber;
    }

    public void setAreaNumber(String areaNumber) {
        this.areaNumber = areaNumber;
    }

    public String getNameEn() {
        return nameEn;
    }

    public void setNameEn(String nameEn) {
        this.nameEn = nameEn;
    }

    public String getNameSh() {
        return nameSh;
    }

    public void setNameSh(String nameSh) {
        this.nameSh = nameSh;
    }

    public String getuProvince() {
        return uProvince;
    }

    public void setuProvince(String uProvince) {
        this.uProvince = uProvince;
    }

    public String getuCity() {
        return uCity;
    }

    public void setuCity(String uCity) {
        this.uCity = uCity;
    }

    public String getSysDepId() {
        return sysDepId;
    }

    public void setSysDepId(String sysDepId) {
        this.sysDepId = sysDepId;
    }

    public String getSysDepIdParent() {
        return sysDepIdParent;
    }

    public void setSysDepIdParent(String sysDepIdParent) {
        this.sysDepIdParent = sysDepIdParent;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("deptId", getDeptId()).
                append("parentId", getParentId()).append("ancestors", getAncestors()).
                append("deptName", getDeptName()).append("orderNum", getOrderNum()).
                append("leader", getLeader()).append("phone", getPhone()).
                append("email", getEmail()).append("status", getStatus()).
                append("delFlag", getDelFlag()).append("createBy", getCreateBy()).
                append("createTime", getCreateTime()).append("updateBy", getUpdateBy()).
                append("updateTime", getUpdateTime()).
                append("creditCode", getUpdateTime()).
                append("typeCode", getUpdateTime()).
                append("areaNumber", getUpdateTime()).
                append("nameEn", getUpdateTime()).
                append("nameSh", getUpdateTime()).
                append("uProvince", getUpdateTime()).
                append("uCity", getUpdateTime()).
                append("sysDepId", getUpdateTime()).
                append("sysDepIdParent", getUpdateTime()).toString();
    }
}
